package cn.wzvtc.inheritance_interface;

import cn.wzvtc.inheritance_interface.person.Employee;
import cn.wzvtc.inheritance_interface.person.Programmer;
import cn.wzvtc.inheritance_interface.person.Sales;

import java.util.*;

/**
 * @author Shiwei Xu
 * @date 2020/4/19
 */
public class Test {
  public static void main(String[] args) {

    Student st1 = new Student(234, "zhangsan");
    Student st2 = new Student(234, "lisi");
//    // 这样打印对象，本质上是打印st1.toString()的结果
//    System.out.println(st1);
//    System.out.println(st2);
//    Student st3 = st1;
//    Student st4 = st1;
//    System.out.println(st3.equals(st4));
//    System.out.println(st1 == st2);
//    System.out.println(st1.equals(st2));

    Set<Student> students = new HashSet<>();
    students.add(st1);
    students.add(st2);

    System.out.println(students);
//
//    Map<Student, String> map = new HashMap<>();
//    map.put(st1, "AAA");
//    map.put(st2, "BBB");
//    System.out.println(map.size());
//
//    Map<String, Object> maps = new HashMap<>();


//    Programmer p1 = new Programmer();
//    Sales s1 = new Sales();
//
//    List<Employee> eList = new ArrayList<>();
//    eList.add(new Programmer());
//    eList.add(new Sales());
//
//    // ...
//    double sum = 0;
//    for (Employee employee : eList) {
//      sum += employee.calcSalary();
//    }

//    List<Programmer> pList = new ArrayList<>();
//    List<Sales> sList = new ArrayList<>();
//    double total = p1.calcSalary() + s1.calcSalary();
  }
}
